<?php
// include function files for this application
require_once('/home/domains/uny-con.com/public_html/uny-con_fns.php');
if (!session_id()) { session_start(); }

//get some variables
$event_id = $_GET['event_id'];
$timeslot = $_GET['timeslot'];


do_html_header("Attendees for event #$event_id in timeslot $timeslot", staysmall, $uny);
if (!check_valid_user()) {
	echo 'You are not logged in, please login with the registration tab above';
	print_brs(6);
	do_html_footer(news);
	exit;
	}


$event_details = recordproc(get_event_details($event_id));

if ($event_details['attendee_id'] == $_SESSION['current_attendee_id'] || $_SESSION['admin'] == 't') {
	echo '<h1>Attendees for '.$event_details['event_title'].'</h1>';
	echo '<ul class="plainul">';
	$result = get_event_attendees($event_id, $timeslot);
	while ($row = pg_fetch_array($result)) {
		echo "<li class=\"infolist\"><a href=\"mailto:".$row["email_addr"]."\">".$row["first_name"].' '.$row["last_name"]."</a> Their registration status is ".$row["registration_status"]."</li>";
		if (isset($email_list)) $email_list = $email_list.', '.$row["email_addr"];
		else $email_list = $row["email_addr"];
		}
	echo '</ul>';
	echo "You can also <a href=\"mailto:$email_list\">email</a> all attendees of your event";
	} else {
	echo "You do not appear to be the GM of this event.";
	}

print_brs(6);
do_html_footer(news);